package com.kk.solr.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @author willz
* @date 2019-09-11
*/
@Entity
@Data
@Table(name="solr_file")
public class SolrFile implements Serializable {

    // 路径
    @Id
    @Column(name = "id")
    private String id;

    // 大小
    @Column(name = "size")
    private Integer size;

    // 作者
    @Column(name = "author")
    private String author;

    // 内容
    @Column(name = "content")
    private String content;

    // 最后修改
    @Column(name = "last_modified")
    private Timestamp lastModified;

    public void copy(SolrFile source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}